package com.px.service;


import com.px.client.ShUserFeignClient;
import com.px.pojo.ShUser;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ShUserServiceImpl implements ShUserService {

    @Resource
    private ShUserFeignClient shUserFeignClient;

    @Resource
    private RabbitTemplate rabbitTemplate;

    @Override
    public List<ShUser> selectUserList(String userName, Integer id, Integer currentPageNo, Integer pageSize) throws Exception {
        Integer offSet = (currentPageNo-1)*pageSize;
        return shUserFeignClient.selectShUserList(userName,id,offSet,pageSize);
    }

    @Override
    public int selectUserCount(String userName, Integer id) throws Exception {
        return shUserFeignClient.selectShUserCount(userName,id);
    }

    @Override
    public ShUser selectUser(Integer userId) throws Exception {
        return shUserFeignClient.selectShUser(userId);
    }

    @Override
    public int insertUser(ShUser shUser) throws Exception {
        return shUserFeignClient.insertShUser(shUser);
    }

    @Override
    public int updateUser(ShUser shUser) throws Exception {
        return shUserFeignClient.updateShUser(shUser);
    }

    @Override
    public int deleteUser(Integer id) throws Exception {
        return shUserFeignClient.deleteShUser(id);
    }
}
